export default {
  computed: {
    // 表格中列字段
    columns() {
      return [
        {
          key: "workshop",
          title: {
            "zh-CN": "车间",
            "en-US": "workshop",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "code",
          title: {
            "zh-CN": "区域编码",
            "en-US": "code",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: true,
        },
        {
          key: "name",
          title: {
            "zh-CN": "区域名称",
            "en-US": "name",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "locationCode",
          title: {
            "zh-CN": "库位",
            "en-US": "locationCode",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: true,
        },
        {
          key: "status",
          title: {
            "zh-CN": "占用状态",
            "en-US": "status",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
          render: (h, params) => {
            return h(
              "Tag",
              {
                attrs: {
                  color: this.getCellBg(params.row.status).color,
                  size:'large'
                },
              },
              this.getCellBg(params.row.status).text
            );
          },
        },
        {
          key: "materialName",
          title: {
            "zh-CN": "物料名称",
            "en-US": "material name",
          }[this.G_Locale],
          minWidth: 200,
          align: "center",
          show: true,
        },
        {
          key: "batchNo",
          title: {
            "zh-CN": "批次",
            "en-US": "batch no",
          }[this.G_Locale],
          minWidth: 100,
          align: "center",
          show: true,
        },
      ];
    },
    queryFormItem() {
      return [
        {
          key: "workshop",
          title: {
            "zh-CN": "车间",
            "en-US": "workshop",
          }[this.G_Locale],
          config: {
            type: "text",
          },
        },
        {
          key: "status",
          title: {
            "zh-CN": "占用状态",
            "en-US": "status",
          }[this.G_Locale],
          config: {
            type: "select",
            options: this.statusOptions,
          },
        },
        {
          key: "code",
          title: {
            "zh-CN": "区域编码",
            "en-US": "code",
          }[this.G_Locale],
          config: {
            type: "text",
          },
        },
        {
          key: "name",
          title: {
            "zh-CN": "区域名称",
            "en-US": "name",
          }[this.G_Locale],
          config: {
            type: "text",
          },
        },
        {
          key: "locationCode",
          title: {
            "zh-CN": "库位",
            "en-US": "locationCode",
          }[this.G_Locale],
          config: {
            type: "text",
          },
        },
      ];
    },
    collapseFormItem() {
      return [
        {
          key: "workshop",
          title: {
            "zh-CN": "车间",
            "en-US": "workshop",
          }[this.G_Locale],
          config: {
            type: "text",
          },
        },
        {
          key: "status",
          title: {
            "zh-CN": "占用状态",
            "en-US": "status",
          }[this.G_Locale],
          config: {
            type: "select",
            options: this.statusOptions,
          },
        },
        {
          key: "name",
          title: {
            "zh-CN": "区域名称",
            "en-US": "name",
          }[this.G_Locale],
          config: {
            type: "text",
          },
        },
      ];
    },
    lang() {
      return {
        "en-US": {
          cancel: "cancel",
          confirmDelete: "confirm delete?",
        },
        "zh-CN": {
          cancel: "取消",
          confirmDelete: "确认删除？",
        },
      }[this.G_Locale];
    },
  },
};
